<?php


namespace app\shop\model;


use think\Model;

class SpecPriceModel extends Model
{
    protected $table = 'dp_spec_price';

    protected $field = true;

    public static function del($goods_id=0)
    {
        return self::where('goods_id',$goods_id)->delete();

    }

    public static function getPrice($goods_id,$spec_key)
    {
        return self::where('goods_id',$goods_id)->where('key',$spec_key)->value('price');
    }

    public static function getByKey($goods_id,$spec_key)
    {
        return self::where('key', $spec_key)->where('goods_id',$goods_id)->find();
    }

    public static function getColumn($goods_id)
    {
        return self::where('goods_id',$goods_id)->column('*','key');
    }

    public static function getKeyList($goods_id)
    {
        return self::where('goods_id',$goods_id)->column('key');
    }


}